﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	导渗系统（每月）
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="dolphincontainer">
	    <div id="dolphinnav">
	        <ul>
                <li><a href="/Record/StackWater/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>水位及水质</span></a></li>
                <li><a href="/Record/BackWater/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>进浆及回水</span></a></li>
                <li><a href="/Record/Settle/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>沉降及位移观测</span></a></li>
                <li><a href="/Record/Ardealite/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>磷石膏堆积坝</span></a></li>
                <li><a href="/Record/Ditch/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>截洪沟</span></a></li>
                <li><a href="/Record/PiezometerWell/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>测压井</span></a></li>
                <li><a href="/Record/PiezometerBase/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>测压仪</span></a></li>
                <li><a href="javascript:return(false);" class="current"><span>导渗系统</span></a></li>
	        </ul>
	    </div>
	</div>

    <%
           bool result = (bool)ViewData["success"];
           if(result){ 
        %>
           <div style="margin-top:20px;font-weight:bold;color:blue;text-align:center">导渗系统更新成功</div>
        <%
        }
        %>

    <% using (Html.BeginForm())
    {
        Dictionary<Drain_system_basic_info, List<Drain_system_outlet_info>> drainOutlets = (Dictionary<Drain_system_basic_info, List<Drain_system_outlet_info>>)ViewData["drainOutlets"];
    %>

        <%= Html.ValidationSummary(true) %>
        <%= Html.Hidden("stack_id", ViewData["id"])%>
        <%= Html.Hidden("factoryId", ViewData["factoryId"]) %>
        <%= Html.Hidden("date", (DateTime)ViewData["date"])%>
            
    <table class="tableCss" cellspacing="0" cellpadding="0" align="center" border="0" style="margin-top:10px">
        <tr>
            <th colspan="2" class="heightrow" align="center" style="text-align:center">
                导渗系统观测（每月）
            </th>
        </tr>
        <tr>
            <td class="row1" align="left" width="100px" style="padding-left:20px">测量人员：</td>
            <td class="row1" align="left">
                <%= Html.DropDownList("tester_id", ViewData["users"] as List<SelectListItem>, "请选择", new { style = "width:150px" })%>
            </td>
        </tr>
        <% if (drainOutlets != null && drainOutlets.Count > 0)
           {
               int i = 1;
               foreach (KeyValuePair<Drain_system_basic_info, List<Drain_system_outlet_info>> drain in drainOutlets)
               {
                   List<Drain_system_outlet_info> outlets = drain.Value;
                   List<Drain_system_Monthly_info> outletRecords = (List<Drain_system_Monthly_info>)ViewData["drainRecords" + i];
                   
        %>
        <tr>
            <td colspan="2">
                <div style="text-align:center;margin-top:10px;margin-bottom:10px">El.<%=drain.Key.El %>m高程导渗系统监测表<%if (!string.IsNullOrEmpty(drain.Key.Pic_filepath)){ %><a href="<%=Url.Content(drain.Key.Pic_filepath) %>" target="_blank">(查看导渗系统出水口)</a><%} %></div>
                <table width="100%" border="1px" style="background-color:White;border:1px solid gray;">
                    <tr height="25px">
                        <td>组别</td>
                        <td>出水口编号</td>
                        <td>对应导渗段</td>
                        <td>是否为导渗段仅有出水口</td>
                        <td>是否为溢流出水口</td>
                        <td>测量流量（m<sup>3</sup>/sec）</td>
                        <td>出水颜色</td>
                        <td>结垢状况</td>
                        <td>备注</td>
                    </tr>
                    <%
                        if (outlets != null & outlets.Count > 0)
                        {
                            for (int j = 0; j < outlets.Count; j++)
                            {
                                bool hasRecord = outletRecords != null && outletRecords.Count > j;
                    %>
                    <tr height="25px">
                        <td><%=outlets[j].Drain_outlet_group_no%></td>
                        <td><%=outlets[j].Drain_outlet_no%></td>
                        <td><%=outlets[j].Drain_outlet_section_no%></td>
                        <td><%=(outlets[j].Is_sole_outlet.HasValue && outlets[j].Is_sole_outlet.Value == 1 ? "是" : "")%>&nbsp;</td>
                        <td><%=(outlets[j].Is_seepage_outlet.HasValue && outlets[j].Is_seepage_outlet.Value == 1 ? "是" : "")%>&nbsp;</td>
                        <td><input type="text" name="Rate_Of_Flow_<%=i %>_<%=outlets[j].Drain_outlet_no %>" value="<%if (hasRecord && outletRecords[j].Rate_Of_Flow.HasValue){%><%=outletRecords[j].Rate_Of_Flow.Value.ToString()%><%}%>" /></td>
                        <td>
                        <select name="Color_of_Flow_<%=i %>_<%=outlets[j].Drain_outlet_no %>">
                            <option value="1" <%= hasRecord && outletRecords[j].Color_of_Flow.HasValue && outletRecords[j].Color_of_Flow.Value == 1 ? "selected" : "" %>>正常</option>
                            <option value="2" <%= hasRecord && outletRecords[j].Color_of_Flow.HasValue && outletRecords[j].Color_of_Flow.Value == 2 ? "selected" : "" %>>略微混浊</option>
                            <option value="3" <%= hasRecord && outletRecords[j].Color_of_Flow.HasValue && outletRecords[j].Color_of_Flow.Value == 3 ? "selected" : "" %>>混浊</option>
                            <option value="4" <%= hasRecord && outletRecords[j].Color_of_Flow.HasValue && outletRecords[j].Color_of_Flow.Value == 4 ? "selected" : "" %>>严重混浊</option>
                        </select>
                        </td>
                        <td>
                        <select name="Deposit_<%=i %>_<%=outlets[j].Drain_outlet_no %>">
                            <option value="1" <%= hasRecord && outletRecords[j].Deposit.HasValue && outletRecords[j].Deposit.Value == 1 ? "selected" : "" %>>无</option>
                            <option value="2" <%= hasRecord && outletRecords[j].Deposit.HasValue && outletRecords[j].Deposit.Value == 2 ? "selected" : "" %>>轻微</option>
                            <option value="3" <%= hasRecord && outletRecords[j].Deposit.HasValue && outletRecords[j].Deposit.Value == 3 ? "selected" : "" %>>典型</option>
                            <option value="4" <%= hasRecord && outletRecords[j].Deposit.HasValue && outletRecords[j].Deposit.Value == 4 ? "selected" : "" %>>严重</option>
                        </select>
                        </td>
                        <td><%=outlets[j].Is_In_Normal_Use.HasValue && outlets[j].Is_In_Normal_Use.Value != 1 ? "该出水口已不能正常监测" : ""%>&nbsp;</td>
                    </tr>
                    <%
                            }
                        }
                    %>

                </table>
            </td>
        </tr>
        <%
                    i++;
               }
           }
        %>
    </table>
    <input type="hidden" name="drainNum" value="<%=drainOutlets != null ? drainOutlets.Count : 0 %>" />
    <div style="margin-top:25px;text-align:center">
        <input type="submit" value="提    交" style="font-size:16px;font-weight:bold" />
    </div>
    <% } %>
</asp:Content>
